package com.cgbl.cg.vm.home

import android.app.Application
import androidx.databinding.ObservableField
import com.robot.base.base.vm.GLBaseViewModel
import me.goldze.mvvmhabit.binding.command.BindingAction
import me.goldze.mvvmhabit.binding.command.BindingCommand
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent

class LimitedTimeViewModel(application: Application):GLBaseViewModel(application) {
    val tabType = ObservableField(true)

    val uc = UiChangeEvent()
    class UiChangeEvent{
        val tabTypeEvent : SingleLiveEvent<Boolean> = SingleLiveEvent()
    }

    val leftCommand = BindingCommand<Any>(BindingAction {
        tabType.set(true)
        uc.tabTypeEvent.postValue(true)
    })

    val rightCommand = BindingCommand<Any>(BindingAction {
        tabType.set(false)
        uc.tabTypeEvent.postValue(false)
    })
}